<?php
	function LinkMySql()
	{
		$HOST="localhost";
		$USER="root";
		$PASS="";
		@$link=new mysqli($HOST,$USER,$PASS);
		if($link->connect_error){
			echo "Connecting to mysql failed:".$php_errormsg.EOL;
			exit;
		}
		$link->query("set names utf8");
		return $link;
	}

	function MysqlQuery($link,$database,$sql)
	{
		@$link->query("use $database");
		$ret=$link->query($sql);
		if(!$ret){
			return false;
		}
		else{
			return $ret;
		}
	}
?>